package com.example.lock.component.lock.autoconfigure;

import com.example.lock.component.lock.executor.LockExecutor;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Description: WedsLock配置
 * @author: sun
 * @date: 2022.01.17
 */
@Getter
@Setter
@ConfigurationProperties(prefix = "wedslock")
public class WedsLockProperties {
    /**
     * 过期时间 单位：毫秒
     */
    private Long lockExpire = 30000L;

    /**
     * 获取锁超时时间 单位：毫秒
     */
    private Long acquireTimeout = 3000L;

    /**
     * 获取锁失败时重试时间间隔 单位：毫秒
     */
    private Long retryInterval = 100L;

    /**
     * 默认执行器，不设置默认取容器第一个(默认注入顺序，redisson>redisTemplate>zookeeper)
     */
    private Class<? extends LockExecutor> primaryExecutor;

    /**
     * 锁key前缀
     */
    private String lockKeyPrefix = "WEDS_LOCK";

}
